#pragma once

#include "../Str.h"
#include <vector>
#include "../../OpenGL.h"
#include "../Img.h"
#include "Model.h"

class Point3D;
class Direction3D;

class _ModelMS3D : public _ModelDef
{
private:
	struct Mesh
	{
		int materialIndex;
		int numTriangles;
		int *triangleIndices;
	};
	struct Material
	{
		float ambient[4], diffuse[4], specular[4], emissive[4];
		float shininess;
		Img *tex;
	};
	struct Triangle
	{
		float vertexNormals[3][3];
		float s[3], t[3];
		int vertexIndices[3];
	};
	struct Vertex
	{
		char boneID;	// for skeletal animation
		float location[3];
	};
	
	std::vector<Mesh> mesh;
	std::vector<Material> material;
	std::vector<Triangle> triangle;
	std::vector<Vertex> vertex;
	
public:
	bool load(const char *filename);
	void draw(int &index,double scale);
};
